<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>13-3d导航-空间缩放</title>
    <style>
        ul {
            margin: 0;
            padding: 0;
            list-style: none;
        }
        .nav {
            width: 400px;
            height: 40px;
            margin: 200px auto 0;
        }
        .nav ul {
            width: 95%;
            /* background: pink; */
            /* 设置为弹性盒子 */
            display: flex;
            justify-content: space-between;
        }
        .nav li {
            position: relative;
            width: 100px;
            height: 40px;
            /* background: pink; */
            line-height: 40px;
            transition: all 1s;
            transform-style: preserve-3d;

            /* 空间缩放 */
            transform: scaleX(0.5);
            transform: scaleY(2);
            transform: scaleZ(3);
            
            transform: scale3d(0.5,2,3);
        }
        .nav li a {
            position: absolute;
            left: 0;
            top: 0;
            display: block;
            width: 100%;
            height: 100%;
            text-align: center;
            text-decoration: none;
            color: #fff;
        }
        /* 立方体每个面都有独立的坐标轴，互不影响 */
        .nav li a:first-child {
            background-color: green;
            transform: translateZ(20px);
        }

        .nav li a:last-child {
            background-color: orange;
            transform: rotateX(90deg) translateZ(20px);
        }
        .nav li:hover {
            transform: rotateX(-90deg);
        }

    </style>
</head>
<body>
    <div class="nav">
        <!-- 无序列表 -->
        <ul>
            <li>
                <a href="#">首页</a>
                <a href="#">Index</a>
            </li>
            <li>
                <a href="#">登录</a>
                <a href="#">Login</a>
            </li>
            <li>
                <a href="#">注册</a>
                <a href="#">Register</a>
            </li>
        </ul>
      </div>
</body>
</html>